
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>ERT生成</title>
  <link rel="stylesheet" href="layui/css/layui.css">
</head>
<body>

<div class="layui-container">
  <div class="layui-progress" style="margin: 15px 0 30px;">
    <div class="layui-progress-bar" lay-percent="100%"></div>
  </div>
  
  
  <div class="layui-container">

    <div class="layui-row">
      <div class="layui-col-md6">
        <!-- <form class="layui-form" enctype="multipart/form-data" action="http://47.119.187.14:9004/pro-api/ertBuild" method="POST"> -->
          <form class="layui-form" enctype="multipart/form-data" action="http://192.168.1.115:8093/ertBuild" method="POST">
            <!-- <form class="layui-form" enctype="multipart/form-data" action="http://localhost:8093/ertBuild" method="POST">  -->
          <div class="layui-form-item">
            <label class="layui-form-label" style="width: 120px;">需计算ert文件</label>
            <div class="layui-input-inline">
              <input type="file" name="calcu">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label" style="width: 120px;">目标ERT文件</label>
            <div class="layui-input-inline">
              <input type="file" name="target">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label" style="width: 120px;">步长</label>
            <div class="layui-input-inline">
              <input type="text" name="step" value="0.5" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">输出类型</label>
            <div class="layui-input-block">
              <input type="radio" name="fileType" value="excle" title="excle">
              <input type="radio" name="fileType" value="dat" title="dat" checked>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <button type="submit" class="layui-btn">立即提交</button>
              <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
          </div>
        </form>
      </div>
      <div class="layui-col-md6">
        <img src="./image/1.png" width="100%"><br/><br/>
        <img src="./image/2.png" width="100%">
      </div>
    </div>
    <blockquote class="layui-elem-quote" style="margin-top: 50px;">不含中文目录的dat压缩文件（zip格式）</blockquote>
      <div class="layui-row">
        <div class="layui-col-md6">
      <form class="layui-form"  enctype="multipart/form-data" action="http://192.168.1.115:8093/mergeDat" method="POST">
        <!-- <form class="layui-form" enctype="multipart/form-data" action="http://47.119.187.14:9004/pro-api/mergeDat" method="POST"> -->
          <!-- <form class="layui-form"  enctype="multipart/form-data" action="http://localhost:8093/mergeDat" method="POST">  -->
      <div class="layui-form-item">
        <label class="layui-form-label" style="width: 120px;">zip文件</label>
        <div class="layui-input-inline">
          <input type="file" name="file" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>
    </div>
    <div class="layui-col-md6"><img src="./image/3.png" width="100%"></div>
    </div>

  </div>
</div>



<!-- 引入 layui.js 的 <script> 标签最好放置在 html 末尾 -->
<script src="layui/layui.js"></script>
<script>
layui.use(function(){
  var layer = layui.layer
  ,form = layui.form
  ,laypage = layui.laypage
  ,element = layui.element
  ,$ = layui.jquery
  ,upload = layui.upload
   //监听提交
  form.on('submit(formDemo)', function(data){
    var formData = new FormData(data);
    console.log(formData)
    $.ajax({
            url: "http://47.119.187.14:9004/pro-api/ertBuild",
            type: "POST",
            data: formData,
            async : false,
            contentType: false,   //jax 中 contentType 设置为 false 是为了避免 JQuery 对其操作，从而失去分界符，而使服务器不能正常解析文件
            processData: false,   //当设置为true的时候,jquery ajax 提交的时候不会序列化 data，而是直接使用data
            error : function(request) {
                parent.layer.alert("网络超时");
            },
            success: function (data) {
                alert("上传成功！");
            }
        });

    return false;
  });
});
</script>
</body>
</html>
